package com.itlong.cloud.operate.resource;

import com.itlong.cloud.POJO.DTO.operate.OperateRenewManageGetDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyInvoiceInfoDTO;
import com.itlong.cloud.POJO.VO.operate.OperateBusinessOperationLogVO;
import com.itlong.cloud.POJO.VO.operate.OperateRenewManageGetVO;
import com.itlong.cloud.POJO.VO.property.PropertyInvoiceInfoVO;
import com.itlong.cloud.operate.service.IOperateRenewManageService;
import com.itlong.cloud.paymenthub.IOperateRenewManageServiceClient;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <desc>
 *      运营-财务续费管理暴露接口实现类
 * </desc>
 *
 * @createDate 2019/08/05
 */
@RestController
public class OperateRenewManageServiceResource implements IOperateRenewManageServiceClient {

    @Autowired
    private IOperateRenewManageService iOperateRenewManageService;

    /**
     * <desc>
     *      分页获取财务续费信息
     * </desc>
     *
     * @param operateRenewManageGetDTO 获取财务续费信息DTO
     * @return 分页财务续费信息
     * @author wangzhi
     * @createDate 2019/08/05
     */
    @Override
    @PostMapping(path = "/operate/renewManage/getPage")
    public Page<OperateRenewManageGetVO> getPage(@RequestBody OperateRenewManageGetDTO operateRenewManageGetDTO) throws Exception {
        return iOperateRenewManageService.getPage(operateRenewManageGetDTO);
    }

    /**
     * <desc>
     *      获取财务续费信息详情
     * </desc>
     *
     * @param operateRenewManageGetDTO 获取财务续费信息DTO
     * @return 财务续费信息详情
     * @author wangzhi
     * @createDate 2019/08/05
     */
    @Override
    @PostMapping(path = "/operate/renewManage/getOne")
    public OperateRenewManageGetVO getOne(@RequestBody OperateRenewManageGetDTO operateRenewManageGetDTO) throws Exception {
        return iOperateRenewManageService.getOne(operateRenewManageGetDTO);
    }
    /**
     * <desc>
     *      财务续费收款确认
     * </desc>
     *
     * @param operateRenewManageGetDTO 财务续费收款确认DTO
     * @return
     * @Author Zhu.yj
     * @createDate  2019/11/27
     */
    @Override
    @PostMapping(path = "/operate/renewManage/confirm")
    public Integer confirm(@RequestBody  OperateRenewManageGetDTO operateRenewManageGetDTO) throws Exception{
        return iOperateRenewManageService.confirm(operateRenewManageGetDTO);
    }

    /**
     * <desc>
     *      财务续费审批
     * </desc>
     *
     * @param operateRenewManageGetDTO 财务续费审批DTO
     * @return 1成功 0失败
     * @author wangzhi
     * @createDate 2019/08/05
     */
    @Override
    @PostMapping(path = "/operate/renewManage/accept")
    public Integer accept(@RequestBody OperateRenewManageGetDTO operateRenewManageGetDTO) throws Exception {
        return iOperateRenewManageService.accept(operateRenewManageGetDTO);
    }

    /**
     * <desc>
     *      获取财务续费信息总金额
     * </desc>
     *
     * @param operateRenewManageGetDTO 财务续费审批DTO
     * @return 财务续费信息总金额
     * @author wangzhi
     * @createDate 2019/08/07
     */
    @Override
    @PostMapping(path = "/operate/renewManage/getTotalAmount")
    public String getTotalAmount(@RequestBody OperateRenewManageGetDTO operateRenewManageGetDTO) throws Exception {
        return iOperateRenewManageService.getTotalAmount(operateRenewManageGetDTO);
    }

    /**
     * <desc>
     *      获取财务续费附加信息
     * </desc>
     *
     * @param operateRenewManageGetDTO 财务续费DTO
     * @return
     * @Author Zhu.yj
     * @createDate  2019/11/22
     */
    @Override
    @PostMapping(path = "/operate/renewManage/getAppendInfo")
    public Map<String, Object> getAppendInfo(@RequestBody OperateRenewManageGetDTO operateRenewManageGetDTO) throws Exception{
        return iOperateRenewManageService.getAppendInfo(operateRenewManageGetDTO);
    }

    /**
     * <desc>
     *      获取发票信息
     * </desc>
     *
     * @param operateRenewManageGetDTO
     * @return
     * @Author Zhu.yj
     * @createDate  2019/11/22
     */
    @Override
    @PostMapping(path = "/operate/renewManage/getBillInfo")
    public PropertyInvoiceInfoVO getBillInfo(@RequestBody OperateRenewManageGetDTO operateRenewManageGetDTO) throws Exception{
        return iOperateRenewManageService.getBillInfo(operateRenewManageGetDTO);
    }

    /**
     * <desc>
     *      开票
     * </desc>
     *
     * @param propertyInvoiceInfoDTO  待开发票DTO
     * @return
     * @Author Zhu.yj
     * @createDate  2019/11/25
     */
    @Override
    @PostMapping(path = "/operate/renewManage/billing")
    public Integer billing(@RequestBody PropertyInvoiceInfoDTO propertyInvoiceInfoDTO) throws Exception{
        return iOperateRenewManageService.billing(propertyInvoiceInfoDTO);
    }
    /**
     * <desc>
     *      获取分页日志信息
     * </desc>
     *
     * @param operateRenewManageGetDTO
     * @return
     * @Author Zhu.yj
     * @createDate  2019/11/27
     */
    @Override
    @PostMapping(path = "operate/renewManage/getLogPage")
    public Page<OperateBusinessOperationLogVO> getLogPage(@RequestBody OperateRenewManageGetDTO operateRenewManageGetDTO) throws Exception {
        return iOperateRenewManageService.getLogPage(operateRenewManageGetDTO);
    }

}
